﻿using System;

class Program
{
    static void Main()
    {
        int[] numbers = { 1, 2, 3, 4, 5 }; // 示例数组

        if (numbers.Length == 0)
        {
            Console.WriteLine("数组为空");
            return;
        }

        int max = numbers[0];
        int min = numbers[0];
        int sum = 0;

        foreach (int num in numbers)
        {
            sum += num;
            if (num > max) max = num;
            if (num < min) min = num;
        }

        double average = (double)sum / numbers.Length;

        Console.WriteLine($"最大值: {max}");
        Console.WriteLine($"最小值: {min}");
        Console.WriteLine($"总和: {sum}");
        Console.WriteLine($"平均值: {average:F2}"); // 保留两位小数
    }
}